//
//  YYMListDetailsViewController.m
//  On The Load
//
//  Created by 我爱的妞 on 15/11/16.
//  Copyright © 2015年 @@叶一闽. All rights reserved.
//

#import "YYMListDetailsViewController.h"
#import <UIImageView+WebCache.h>
#import "YMDetailsListModel.h"

@interface YYMListDetailsViewController ()

@property (strong, nonatomic) IBOutlet UIImageView *mainImageView;
@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
@property (strong, nonatomic) IBOutlet UILabel *distanceLabel;
@property (strong, nonatomic) IBOutlet UILabel *tagsLabel;

@property (strong, nonatomic) IBOutlet UILabel *desLabel;
@property (strong, nonatomic) IBOutlet UILabel *addressLabel;
@property (strong, nonatomic) IBOutlet UIImageView *mapLabel;
@property (strong, nonatomic) IBOutlet UILabel *phoneLabel;
@property (strong, nonatomic) IBOutlet UILabel *infoLabel;
@property (strong, nonatomic) IBOutlet UIImageView *headerLabel;
@property (strong, nonatomic) IBOutlet UILabel *nameLabel;
@property (strong, nonatomic) IBOutlet UILabel *ratingLabel;
@property (strong, nonatomic) IBOutlet UIScrollView *bgScrollView;
- (IBAction)callAction:(id)sender;

@end

@implementation YYMListDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"详细信息";
    _bgScrollView.contentSize = CGSizeMake(0, 680);
    _bgScrollView.bounces = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)setModel:(YMDetailsListModel *)model{
    
    _model = model;
    
    [_mainImageView sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:nil];
    _titleLabel.text = model.name;
    _distanceLabel.text = @"超过50km";
    _tagsLabel.text = model.feature;
    _desLabel.text = model.impression;
    _addressLabel.text = model.address;
    _phoneLabel.text = model.phone;
    _infoLabel.text = model.toprank;
}

- (IBAction)callAction:(id)sender {
    
    NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"18688886979"];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
@end
